package edu.sysu.demo.petstore.dog.data.entity;


import java.io.Serializable;
import java.time.LocalDate;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author lijinting01
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "t_user")
public class User implements Serializable {

  private static final long serialVersionUID = -9201239016323279203L;
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  @Column(length = 50, nullable = false, unique = true)
  private String username;

  @Column(length = 512, nullable = false)
  private String password;

  @OneToMany
  private Collection<Role> roles;

  @Column(nullable = false)
  private Boolean enabled;

  @Column(nullable = false)
  private Boolean locked;

  @Column(nullable = false)
  private LocalDate expireAt;
}
